home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SSSSTTTTFFFFEEEE((((3333XXXX)))) SSSSTTTTFFFFEEEE((((3333XXXX))))
-
-
-
- NNNNAAAAMMMMEEEE
- stfe - routines that provide a high-level interface to basic functions
- needed to access and add to the symbol table
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyymmmmssss....hhhh>>>>
-
- lllloooonnnngggg sssstttt____ffffiiiilllleeeebbbbeeeeggggiiiinnnn((((cccchhhhaaaarrrr ****ffffiiiilllleeeennnnaaaammmmeeee))));;;;
-
- lllloooonnnngggg sssstttt____eeeennnnddddaaaallllllllffffiiiilllleeeessss((((vvvvooooiiiidddd))));;;;
-
- lllloooonnnngggg sssstttt____ffffiiiilllleeeeeeeennnndddd((((lllloooonnnngggg iiiiddddnnnn))));;;;
-
- lllloooonnnngggg sssstttt____bbbblllloooocccckkkkbbbbeeeeggggiiiinnnn((((lllloooonnnngggg iiiissssssss,,,, lllloooonnnngggg vvvvaaaalllluuuueeee,,,, lllloooonnnngggg sssscccc))));;;;
-
- lllloooonnnngggg sssstttt____tttteeeexxxxttttbbbblllloooocccckkkk((((vvvvooooiiiidddd))));;;;
-
- lllloooonnnngggg sssstttt____bbbblllloooocccckkkkeeeennnndddd((((lllloooonnnngggg ssssiiiizzzzeeee))));;;;
-
- lllloooonnnngggg sssstttt____pppprrrroooocccceeeennnndddd((((lllloooonnnngggg iiiiddddnnnn))));;;;
-
- lllloooonnnngggg sssstttt____pppprrrrooooccccbbbbeeeeggggiiiinnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
-
- cccchhhhaaaarrrr ****sssstttt____ssssttttrrrr____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
-
- cccchhhhaaaarrrr ****sssstttt____ssssyyyymmmm____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn,,,, lllloooonnnngggg ****sssscccc,,,, lllloooonnnngggg ****sssstttt,,,, lllloooonnnngggg ****vvvvaaaalllluuuueeee,,,, lllloooonnnngggg ****iiiinnnnddddeeeexxxx))));;;;
-
- lllloooonnnngggg sssstttt____aaaabbbbssss____iiiiffffdddd____iiiinnnnddddeeeexxxx((((lllloooonnnngggg iiiiffffdddd,,,, lllloooonnnngggg iiiinnnnddddeeeexxxx))));;;;
-
- lllloooonnnngggg sssstttt____ffffgggglllloooobbbbaaaallll____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
-
- ppppSSSSYYYYMMMMRRRR sssstttt____ppppssssyyyymmmm____iiiiddddnnnn____ooooffffffffsssseeeetttt((((lllloooonnnngggg iiiiddddnnnn;;;; lllloooonnnngggg ooooffffffffsssseeeetttt))));;;;
-
- lllloooonnnngggg sssstttt____ppppddddaaaadddddddd____iiiiddddnnnn((((lllloooonnnngggg iiiiddddnnnn))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The _s_t_f_e routines provide a high-level interface to the symbol table
- based on common needs of the compiler front-ends.
-
- _s_t__f_i_l_e_b_e_g_i_n
- Takes a file name and calls _s_t__f_d_a_d_d (see the _s_t_f_d manual page).
- If it's a new file, a symbol is added to the symbol table for it
- and the user supplied routine, _s_t__f_e_i_n_i_t, is called. This allows
- special once per file things to be initialized (for example, the
- C front-end adds basic type auxiliaries to each file's aux table
- so that all variables of that type can refer to a single instance
- instead of making individual copies of them). _s_t__f_i_l_e_b_e_g_i_n
- returns a dense number that references the symbol added for this
- file. It tracks files as they appear in a CPP line directive
- with a stack. It detects (from the order of the CPP directives)
- that a file ends and calls _s_t__f_i_l_e_n_d. If a file is closed with a
- _s_t__f_i_l_e_e_n_d, a new instance of the filename is created (for
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- SSSSTTTTFFFFEEEE((((3333XXXX)))) SSSSTTTTFFFFEEEE((((3333XXXX))))
-
-
-
- example, multiply included files).
-
- _s_t__f_i_l_e_e_n_d
- Requires the dense number from the corresponding _s_t__f_i_l_e_b_e_g_i_n
- call for the file in question. It then generates an end symbol
- and patches the references so that the index field of the begin
- file points to that of one beyond the end file. The end file
- points to the begin file.
-
- _s_t__e_n_d_a_l_l_f_i_l_e_s
- Is called at the end of execution to close off all files that
- haven't been ended by previous calls to _s_t__f_i_l_e_b_e_g_i_n. CPP
- directives might not reflect the return to the original source
- file; therefore, this routine can possibly close many files.
-
- _s_t__b_l_o_c_k_b_e_g_i_n
- Supports language blocks (for example, C's left curly brace
- blocks), beginning of structures, and unions. If the storage
- class is scText, it is the former; if it is scInfo, it is one of
- the latter. The iss (index into string space) specifies the name
- of the structure/etc, if any.
-
- If the storage class is scText, we must check the result of
- _s_t__b_l_o_c_k_b_e_g_i_n. It returns a dense number for outer blocks and a zero for
- nested blocks. The non-zero block number should be used in the BGNB
- ucode. Users of languages without nested blocks that provide variable
- declarations can ignore the rest of this paragraph. Nested blocks are
- two-staged: one stage happens when we detect the language block and the
- other stage happens when we know the block has content. If the block has
- content (for example, local variables), the front-end must call
- _s_t__t_e_x_t_b_l_o_c_k to get a non-zero dense number for the block's BGNB ucode.
- If the block has no content and _s_t__t_e_x_t_b_l_o_c_k is not called, the block's
- _s_t__b_l_o_c_k_b_e_g_i_n and _s_t__b_l_o_c_k_e_n_d do not produce block and end symbols.
-
- If it is scInfo, _s_t__b_l_o_c_k_b_e_g_i_n creates a begin block symbol in the symbol
- table and returns a dense number referencing it. The dense number is
- necessary to build the auxiliary required to reference the structure/etc.
- It goes in the aux after the TIR along with a file index. This dense
- number is also noted in a stack of blocks used by _s_t__b_l_o_c_k_e_n_d.
-
- _s_t__b_l_o_c_k_b_e_g_i_n should not be called for language blocks when the front-end
- is not producing debugging symbols.
-
- _s_t__b_l_o_c_k_e_n_d requires that blocks occur in a nested fashion. It retrieves
- the dense number for the most recently started block and creates a
- corresponding end symbol. As in _f_i_l_e_e_n_d, both the begin and end symbol
- index fields point at the other end's symbol. If the symbol ends a
- structure/etc., as determined by the storage class of the begin symbol,
- the size parameter is assigned to the begin symbol's value field. It's
- usually the size of the structure or max value of a enum. We only know
- it at this point. The dense number of the end symbol is returned so that
- the ucode ENDB can be use it. If it is an ignored text block, the dense
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- SSSSTTTTFFFFEEEE((((3333XXXX)))) SSSSTTTTFFFFEEEE((((3333XXXX))))
-
-
-
- number is zero and no ENDB should be generated.
-
- In general, defined external procedures or functions appear in the
- symbols table and the externals table. The external table definition must
- occur first through the use of a _s_t__e_x_t_a_d_d. After that definition,
- _s_t__p_r_o_c_b_e_g_i_n can be called with a dense number referring to the external
- symbol for that procedure. It checks to be sure we have a defined
- procedure (by checking the storage class). It adds a procedure symbol to
- the symbol table. The external's index should point at its auxiliary data
- type information (or if debugging is off, indexNil). This index is
- copied into the regular symbol's index field or a copy of its type is
- generated (if the external is in a different file than the regular
- symbol). Next, we put the index to symbol in the external's index field.
- The external's dense number is used as a block number in ucodes
- referencing it and is used to add a procedure when in the _s_t__p_d_a_d_d__i_d_n.
-
- _s_t__p_r_o_c_e_n_d
- Creates an end symbol and fixes the indices as in _b_l_o_c_k_e_n_d and
- _f_i_l_e_e_n_d, except that the end procedure reference is kept in the
- begin procedure's aux rather than in the index field (because the
- begin procedure has a type as well as an end reference). This
- must be called with the dense number of the procedure's external
- symbol as an argument and returns the dense number of the end
- symbol to be used in the END ucode.
-
- _s_t__s_t_r__i_d_n
- Returns the string associated with symbol or external referenced
- by the dense number argument. If the symbol was anonymous (for
- example, there was no symbol) a (char *)-1 is returned.
-
- _s_t__s_y_m__i_d_n
- Returns the same result as _s_t__s_t_r__i_d_n, except that the rest of
- the fields of the symbol specified by the _i_d_n are returned in the
- arguments.
-
- _s_t__f_g_l_o_b_a_l__i_d_n
- Returns a 1 if the symbol associated with the specified idn is
- non-static; otherwise, a 0 is returned.
-
- _s_t__a_b_s__i_f_d__i_n_d_e_x
- Returns the absolute offset for a dense number. If the symbol is
- global, the global's index is returned. If the symbol occurred in
- a file, the sum of all symbols in files occurring before that
- file and the symbol's index within the file is returned.
-
- _s_t__p_d_a_d_d__i_d_n
- Adds an entry to the procedure table for the _s_t__p_r_o_c _e_n_t_r_y
- generated by procbegin. This should be called when the front-end
- generates code for the procedure in question.
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- SSSSTTTTFFFFEEEE((((3333XXXX)))) SSSSTTTTFFFFEEEE((((3333XXXX))))
-
-
-
- The programs must be loaded with the object file access routine library
- libmld.a.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- stcu(3x), stfd(3x)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-